package com.unicomcz.query;

import java.sql.ResultSet;
import java.util.List;

import com.unicomcz.DetailPageAction;

public class QueryHmAction extends DetailPageAction
{
    private String kaHao;

    /**
     * @return the kaHao
     */
    public String getKaHao()
    {
        return kaHao;
    }

    /**
     * @param kaHao the kaHao to set
     */
    public void setKaHao(String kaHao)
    {
        this.kaHao = kaHao;
    }

    /* (non-Javadoc)
     * @see com.unicomcz.DetailPageAction#getSqlStr()
     */
    @Override
    public String getSqlStr()
    {
        String sql="select serial_number,product_name,open_time,user_state,balance,charge from dls_user_info where ka_hao=?";
        return sql;
    }
    public Object[] getParams() {
        return new Object[]{kaHao};
    }
    protected void regQueryParam() throws Exception{      
        log.debug(userInfo.getDepartCode());
        pstmt.setString(1, kaHao);
    }
    protected void rs2List(ResultSet rs,List out) throws Exception{
        HmBean t = new HmBean();
        t.setSerialNumber(rs.getString(1));
        t.setProductName(rs.getString(2));
        t.setOpenTime(rs.getString(3));
        t.setUserState(rs.getString(4));
        t.setBalance(rs.getString(5));
        t.setCharge(rs.getString(6));
        out.add(t);
    }

}
